package us.wili.dev.model.base;

import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import us.wili.dev.common.model.BaseModelWithId;

public class BaseShipaddress extends BaseModelWithId implements Serializable {
    @ApiModelProperty(value="用户id")
    private Long userid;

    @ApiModelProperty(value="收货地址")
    private String address;

    @ApiModelProperty(value="详细地址")
    private String addressDeta;

    @ApiModelProperty(value="收件人")
    private String shipname;

    @ApiModelProperty(value="联系方式")
    private String shipphone;

    @ApiModelProperty(value="0:默认地址 1:非默认地址")
    private Integer defaultaddress;

    public Long getUserid() {
        return userid;
    }

    public void setUserid(Long userid) {
        this.userid = userid;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address == null ? null : address.trim();
    }

    public String getAddressDeta() {
        return addressDeta;
    }

    public void setAddressDeta(String addressDeta) {
        this.addressDeta = addressDeta == null ? null : addressDeta.trim();
    }

    public String getShipname() {
        return shipname;
    }

    public void setShipname(String shipname) {
        this.shipname = shipname == null ? null : shipname.trim();
    }

    public String getShipphone() {
        return shipphone;
    }

    public void setShipphone(String shipphone) {
        this.shipphone = shipphone == null ? null : shipphone.trim();
    }

    public Integer getDefaultaddress() {
        return defaultaddress;
    }

    public void setDefaultaddress(Integer defaultaddress) {
        this.defaultaddress = defaultaddress;
    }

    public void copyPropertiesFrom(BaseShipaddress source) {
        this.setUserid(source.getUserid());
        this.setAddress(source.getAddress());
        this.setAddressDeta(source.getAddressDeta());
        this.setShipname(source.getShipname());
        this.setShipphone(source.getShipphone());
        this.setDefaultaddress(source.getDefaultaddress());
    }

    public void copyAndIgnoreNullFrom(BaseShipaddress source) {
        if (source.getUserid() != null) {
            this.setUserid(source.getUserid());
        }
        if (source.getAddress() != null) {
            this.setAddress(source.getAddress());
        }
        if (source.getAddressDeta() != null) {
            this.setAddressDeta(source.getAddressDeta());
        }
        if (source.getShipname() != null) {
            this.setShipname(source.getShipname());
        }
        if (source.getShipphone() != null) {
            this.setShipphone(source.getShipphone());
        }
        if (source.getDefaultaddress() != null) {
            this.setDefaultaddress(source.getDefaultaddress());
        }
    }
}